import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cssPlugin from 'postcss-pxtorem';

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    host: '0.0.0.0',
    port: 2333
  },
  plugins: [vue()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    },
  },
  css: {
    postcss: {
      plugins: [cssPlugin({
        rootValue: 37.5,
        unitPrecision: 5,
        propList: ['*'],
        replace: true,
        mediaQuery: false,
        minPixelValue: 1,
        exclude: /node_modules/i,
      }),
      ],
    },
  },
})
